package cn.krund.lyc.hotlerobot.activity.ui;

import android.app.AlertDialog;
import android.content.ComponentName;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Build;
import android.view.KeyEvent;
import android.view.View;

import cn.krund.lyc.hotlerobot.R;
import cn.krund.lyc.hotlerobot.activity.base.BaseActivity;
import cn.krund.lyc.hotlerobot.utils.NetWorkUtils;

/**
 * @包名: cn.krund.lyc.hotlerobot.activity.ui
 * @作者: 刘育成
 * @时间: 2018/3/21  14:27
 * @org: 克路德人工智能
 * @描述: TODO
 * @fileName: GuideActivity
 */

public class GuideActivity extends BaseActivity {
    @Override
    protected int getLayoutId() {
        return R.layout.activity_guide;
    }

    @Override
    protected void initView() {

    }

    @Override
    protected void initNev() {

    }


    @Override
    protected void onResume() {
        super.onResume();
        if (NetWorkUtils.checkEnable(this)) {
            new Thread(mRunnable).start();
        } else {

            AlertDialog.Builder builder = new AlertDialog.Builder(this);
            builder.setTitle("设置网络");
            builder.setPositiveButton("确定", new DialogInterface.OnClickListener() {
                @Override
                public void onClick(DialogInterface dialog, int which) {
//                    Intent intent = new Intent();
//                    intent.setComponent(new ComponentName("com.android.settings", "com.android.settings.wifi.WifiPickerActivity"));
//                    startActivityForResult(intent, 100);
                    openActivity(WifiFunctionActivity.class);
                }
            });
            builder.setNegativeButton("取消", new DialogInterface.OnClickListener() {
                @Override
                public void onClick(DialogInterface dialog, int which) {
                    dialog.dismiss();
                }
            });
            builder.show();
        }
    }

    Runnable mRunnable = new Runnable() {
        @Override
        public void run() {
            //判断是否绑定注册过
            openActivity(LoginActivity.class);
        }
    };
}
